package R

import "github.com/gin-gonic/gin"

func Result(code int, msg string, data interface{}) map[string]interface{} {
	return gin.H{
		"code": code,
		"msg":  msg,
		"data": data,
	}
}

func Ok(data interface{}) map[string]interface{} {
	return gin.H{
		"code": 200,
		"msg":  "ok",
		"data": data,
	}
}

func Fail(msg string) map[string]interface{} {
	return gin.H{
		"code": 500,
		"msg":  msg,
	}
}
